Fix the block-sharing check for physical devices by using a lock to serialise
the check, reading from the store rather than /sys, and checking whether the
VM for apparently-conflicting uses is actually the same (i.e. this is a
migration or a reboot in progress).
This fixes recent failures in 12_block_attach_shared_domU and recloses bug #331.
This fix includes particularly skanky path slicing inside xenbus_probe, which
it would be nice to remove very soon.
The loopback device check still suffers from the problem that filenames over
64 characters long are truncated.
Signed-off-by: Ewan Mellor <ewan@xensource.com>